---
id: 656709e50ed928da35260276
title: Step 15
challengeType: 20
dashedName: step-15
---

# --description--

In a previous step, you assigned the element in the `left_part` to the `array` list because it was smaller. But this will not always be the case. In some comparison cases, the element on the right could be smaller.

Create an `else` clause to execute when the `left_part` index is not less than the `right_part` index.

Inside the `else` block, assign `right_part[right_array_index]` to `array[sorted_index]`.

# --hints--

You should have `array[sorted_index] = right_part[right_array_index]` in the body of your `else` clause.

```js
({
  test: () => {
    const transformedCode = code.replace(/\r/g, "");
    const merge_sort = __helpers.python.getDef("\n" + transformedCode, "merge_sort");
    const { function_body } = merge_sort;

    assert.match(function_body, /else:\s*[^}]*array\s*\[\s*sorted_index\s*\]\s*=\s*right_part\s*\[\s*right_array_index\s*\]/);
  }
})
```

# --seed--

## --seed-contents--

```py
def merge_sort(array):

    middle_point = len(array) // 2
    left_part = array[:middle_point]
    right_part = array[middle_point:]

    merge_sort(left_part)
    merge_sort(right_part)

    left_array_index = 0
    right_array_index = 0
    sorted_index = 0

    while left_array_index < len(left_part) and right_array_index < len(right_part):
--fcc-editable-region--
        if left_part[left_array_index] < right_part[right_array_index]:
            array[sorted_index] = left_part[left_array_index]
            left_array_index += 1
--fcc-editable-region--
```
